package com.internship.controller;

import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import net.sf.json.JSONObject;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.servlet.ModelAndView;

import com.internship.model.Bjdmb;
import com.internship.model.City;
import com.internship.model.DepartmentInfo;
import com.internship.model.Distribution;
import com.internship.model.EnterpriseInfo;
import com.internship.model.EnterpriseUser;
import com.internship.model.JobInfo;
import com.internship.model.JobStudent;
import com.internship.model.PracticeComment;
import com.internship.model.ProfessionInfo;
import com.internship.model.Province;
import com.internship.model.StudentInfo;
import com.internship.model.TeacherInfo;
import com.internship.page.Page;
import com.internship.service.BjdmbService;
import com.internship.service.Const;
import com.internship.service.DepartmentInfoService;
import com.internship.service.EnterpriseInfoService;
import com.internship.service.EnterpriseUserService;
import com.internship.service.JobInfoService;
import com.internship.service.JobStudentService;
import com.internship.service.PracticeCommentService;
import com.internship.service.ProfessionInfoService;
import com.internship.service.StudentInfoService;
import com.internship.service.TeacherInfoService;
import com.internship.util.ObjectExcelView;
import com.internship.util.StringUtil;


@Controller
@RequestMapping("jobStudent")
public class JobStudentController {
	private final Logger logger = Logger.getLogger(JobStudentController.class);
	
	@Autowired
	private ProfessionInfoService professionInfoService;
	@Autowired
	private DepartmentInfoService 	departmentInfoService;
	@Autowired
	private BjdmbService 	bjdmbService;
	@Autowired
	private StudentInfoService 	studentInfoService;
	@Autowired
	private JobStudentService 	jobStudentService;
	@Autowired
	private PracticeCommentService 	practiceCommentService;
	@Autowired
	private EnterpriseInfoService 	enterpriseinfoService;
	@Autowired
	private EnterpriseUserService	enterpriseUserService;
	@Autowired
	private TeacherInfoService teacherInfoService;
	@Autowired
	private JobInfoService jobInfoService;
	public static HttpSession getSession() {
		HttpSession session = null;
		try {
			session = getRequest().getSession();
		} catch (Exception e) {
		}
		return session;
	}

	public static HttpServletRequest getRequest() {
		ServletRequestAttributes attrs = (ServletRequestAttributes) RequestContextHolder
				.getRequestAttributes();
		return attrs.getRequest();
	}
	private void clearSession() {
		getSession().invalidate();
	}
	/**?
	 * 学生实习分配列表
	 * @return
	 */
	@RequestMapping("/jobStudent_list.do")
	public ModelAndView getStudentInfoList() {
		return getStudentInfoList(null,null,null,null,0,0,1);
	}
	private List<DepartmentInfo>  departmentInfoList = null;
	private List<ProfessionInfo>  professionInfoList = null;
	private List<Distribution>  distributionList = null;
	private List<Bjdmb>  bjdmbList = null;
	@RequestMapping("/jobStudent_page_list.do")
	public ModelAndView getStudentInfoList(@RequestParam String XM,@RequestParam String XY,@RequestParam String ZYDM,@RequestParam String XZB,@RequestParam int DQSZJ,@RequestParam int state,@RequestParam int pageNumber) {
		ModelAndView mv = new ModelAndView("practice_student_list");
		HttpSession session = getSession();
		try {
			if (String.valueOf(session.getAttribute(Const.USER_ROLE)).equals("2")||String.valueOf(session.getAttribute(Const.USER_ROLE)).equals("1")) {
				this.departmentInfoList = departmentInfoService.getDepartmentInfoList();
				if(XY==null||XY.equals("")){
					this.professionInfoList = professionInfoService.getProfessionInfoList();
					this.bjdmbList = bjdmbService.getBjdmbList();
				}else {
					DepartmentInfo departmentInfo=	departmentInfoService.getDepartmentInfo(XY);
					if (departmentInfo!=null) {
						this.professionInfoList = professionInfoService.getProfessionInfo(departmentInfo.getXYDM());
						if(ZYDM!=null){
							this.bjdmbList = bjdmbService.getBjdmb(departmentInfo.getXYDM(),ZYDM);
						}else {
							this.bjdmbList = bjdmbService.getBjdmb(departmentInfo.getXYDM(),null);	
						}
					}
				}
				mv.addObject("XY", XY);
				mv.addObject("ZYDM", ZYDM);
				mv.addObject("XZB", XZB);
				mv.addObject("departmentInfoList",departmentInfoList);
				mv.addObject("professionInfoList",professionInfoList);
				mv.addObject("bjdmbList",bjdmbList);
				if( state == 1){
					Page<JobStudent> pageList = jobStudentService.getJobStudentList(XM, XY, ZYDM, XZB,null, DQSZJ, pageNumber);
					mv.addObject("currentPage", pageNumber);
					mv.addObject("totalPage", pageList.getTotalPage());
					mv.addObject("totalCount", pageList.getTotalCount());
					mv.addObject("jobStudentList", pageList.getResultList());
				}else if ( state == 2) {
					Page<StudentInfo> pageList = studentInfoService.getStudentNotMatchList(XM, XY, ZYDM, XZB,null, DQSZJ, pageNumber);
					mv.addObject("currentPage", pageNumber);
					mv.addObject("totalPage", pageList.getTotalPage());
					mv.addObject("totalCount", pageList.getTotalCount());
					mv.addObject("jobStudentList", pageList.getResultList());
				}else {
					Page<JobStudent> pageList = jobStudentService.getJobStudentList(XM, XY, ZYDM, XZB,null, DQSZJ, pageNumber);
					mv.addObject("currentPage", pageNumber);
					mv.addObject("totalPage", pageList.getTotalPage());
					mv.addObject("totalCount", pageList.getTotalCount());
					mv.addObject("jobStudentList", pageList.getResultList());
				}
				/*else {
					System.out.println("11111111111");
					Page<JobStudent> pageList = jobStudentService.getJobStudentList(XM, XY, ZYDM, XZB, DQSZJ, pageNumber);
					Page<StudentInfo> pageList1 = studentInfoService.getStudentNotMatchList(XM, XY, ZYDM, XZB, DQSZJ, pageNumber);
					mv.addObject("currentPage", pageNumber);
					mv.addObject("totalPage", pageList.getTotalPage());
					mv.addObject("totalCount", pageList.getTotalCount());
					mv.addObject("jobStudentList", pageList.getResultList());
					mv.addObject("totalPage", pageList1.getTotalPage());
					mv.addObject("totalCount", pageList1.getTotalCount());
					mv.addObject("jobStudentList", pageList1.getResultList());
				}*/
			}else if(String.valueOf(session.getAttribute(Const.USER_ROLE)).equals("3")){
				this.professionInfoList = professionInfoService.getProfessionInfo(String.valueOf(session.getAttribute(Const.USER_DEPARTMENT_CODE)));
				this.bjdmbList = bjdmbService.getBjdmb(String.valueOf(session.getAttribute(Const.USER_DEPARTMENT_CODE)),null);
				mv.addObject("currentPage", pageNumber);
				mv.addObject("bjdmbList",bjdmbList);
				mv.addObject("professionInfoList",professionInfoList);
				mv.addObject("ZYDM", ZYDM);
				mv.addObject("XZB", XZB);
				if( state == 1){
					Page<JobStudent> pageList = jobStudentService.getJobStudentList(XM,  String.valueOf(session.getAttribute(Const.USER_DEPARTMENT_NAME)), ZYDM, XZB,null, DQSZJ, pageNumber);
					mv.addObject("currentPage", pageNumber);
					mv.addObject("totalPage", pageList.getTotalPage());
					mv.addObject("totalCount", pageList.getTotalCount());
					mv.addObject("jobStudentList", pageList.getResultList());
				}else if ( state == 2) {
					Page<StudentInfo> pageList = studentInfoService.getStudentNotMatchList(XM, String.valueOf(session.getAttribute(Const.USER_DEPARTMENT_NAME)), ZYDM, XZB,null, DQSZJ, pageNumber);
					mv.addObject("currentPage", pageNumber);
					mv.addObject("totalPage", pageList.getTotalPage());
					mv.addObject("totalCount", pageList.getTotalCount());
					mv.addObject("jobStudentList", pageList.getResultList());
				}else {
					Page<JobStudent> pageList = jobStudentService.getJobStudentList(XM, String.valueOf(session.getAttribute(Const.USER_DEPARTMENT_NAME)), ZYDM, XZB,null, DQSZJ, pageNumber);
					mv.addObject("currentPage", pageNumber);
					mv.addObject("totalPage", pageList.getTotalPage());
					mv.addObject("totalCount", pageList.getTotalCount());
					mv.addObject("jobStudentList", pageList.getResultList());
				}
			}else {
				this.bjdmbList = bjdmbService.getBjdmbByTh(String.valueOf(session.getAttribute(Const.SESSION_ACCOUNT)));
				mv.addObject("currentPage", pageNumber);
				mv.addObject("bjdmbList",bjdmbList);
				mv.addObject("professionInfoList",professionInfoList);
				mv.addObject("ZYDM", ZYDM);
				mv.addObject("XZB", XZB);
				if( state == 1){
					Page<JobStudent> pageList = jobStudentService.getJobStudentList(XM,null, null, XZB,String.valueOf(session.getAttribute(Const.SESSION_ACCOUNT)), DQSZJ, pageNumber);
					mv.addObject("currentPage", pageNumber);
					mv.addObject("totalPage", pageList.getTotalPage());
					mv.addObject("totalCount", pageList.getTotalCount());
					mv.addObject("jobStudentList", pageList.getResultList());
				}else if ( state == 2) {
					Page<StudentInfo> pageList = studentInfoService.getStudentNotMatchList(XM, null, null, XZB, String.valueOf(session.getAttribute(Const.SESSION_ACCOUNT)), DQSZJ, pageNumber);
					mv.addObject("currentPage", pageNumber);
					mv.addObject("totalPage", pageList.getTotalPage());
					mv.addObject("totalCount", pageList.getTotalCount());
					mv.addObject("jobStudentList", pageList.getResultList());
				}else {
					Page<JobStudent> pageList = jobStudentService.getJobStudentList(XM,null, null, XZB,String.valueOf(session.getAttribute(Const.SESSION_ACCOUNT)), DQSZJ, pageNumber);
					mv.addObject("currentPage", pageNumber);
					mv.addObject("totalPage", pageList.getTotalPage());
					mv.addObject("totalCount", pageList.getTotalCount());
					mv.addObject("jobStudentList", pageList.getResultList());
				}
			}
			String[] gradeList = StringUtil.getCurrentGrades();
			mv.addObject("gradeList", gradeList);
			this.distributionList = jobStudentService.getDistributionList();
			mv.addObject("getDistributionList", distributionList);
			mv.addObject("state", state);
			mv.addObject("DQSZJ", DQSZJ);
			mv.addObject("XM", XM);
		} catch (Exception ex) {
			ex.printStackTrace();
		}
		return mv;
	}
	@RequestMapping("/departmentInfo.do")
	@ResponseBody
	public JSONObject departmentInfo(@RequestParam("XYMC")String  XYMC) {
		JSONObject json = new JSONObject();
		DepartmentInfo departmentInfo=	departmentInfoService.getDepartmentInfo(XYMC);
		if (departmentInfo!=null) {
			this.professionInfoList = professionInfoService.getProfessionInfo(departmentInfo.getXYDM());
			this.bjdmbList = bjdmbService.getBjdmb(departmentInfo.getXYDM(),null);
		}else {
			this.professionInfoList = professionInfoService.getProfessionInfoList();
			this.bjdmbList = bjdmbService.getBjdmbList();
		}
		json.put("bjdmbList", bjdmbList);
		json.put("professionInfoList", professionInfoList);
		return json;
	}
	@RequestMapping("/professionInfo.do")
	@ResponseBody
	public JSONObject professionInfo(@RequestParam("ZYDM")String  ZYDM,@RequestParam("XYMC")String  XYMC) {
		JSONObject json = new JSONObject();
		DepartmentInfo departmentInfo=	departmentInfoService.getDepartmentInfo(XYMC);
		if (departmentInfo!=null) {
		this.bjdmbList = bjdmbService.getBjdmb(departmentInfo.getXYDM(),ZYDM);
	
		}else {
			this.bjdmbList = bjdmbService.getBjdmb(null,ZYDM);
		}	
		json.put("bjdmbList", bjdmbList);
		return json;
	}
	
	
	/**
	 * 学生实习汇总列表
	 */
	@RequestMapping("/practice_summary_list.do")
	public ModelAndView getPracticeSummaryList() {
		return getPracticeSummaryList(null,null,null,null,0,1);
	}
	@RequestMapping("/practice_summary_page_list.do")
	public ModelAndView getPracticeSummaryList(@RequestParam String XM,@RequestParam String XY,@RequestParam String ZYDM,@RequestParam String XZB,@RequestParam int DQSZJ,@RequestParam int pageNumber) {
		ModelAndView mv = new ModelAndView("practice_summary_list");
		HttpSession session = getSession();
		try {
			if (String.valueOf(session.getAttribute(Const.USER_ROLE)).equals("2")||String.valueOf(session.getAttribute(Const.USER_ROLE)).equals("1")) {
				this.departmentInfoList = departmentInfoService.getDepartmentInfoList();
				if(XY==null||XY.equals("")){
					this.professionInfoList = professionInfoService.getProfessionInfoList();
					this.bjdmbList = bjdmbService.getBjdmbList();
				}else {
					DepartmentInfo departmentInfo=	departmentInfoService.getDepartmentInfo(XY);
					if (departmentInfo!=null) {
						this.professionInfoList = professionInfoService.getProfessionInfo(departmentInfo.getXYDM());
						if(ZYDM!=null){
							this.bjdmbList = bjdmbService.getBjdmb(departmentInfo.getXYDM(),ZYDM);
						}else {
							this.bjdmbList = bjdmbService.getBjdmb(departmentInfo.getXYDM(),null);	
						}
					}
				}
				mv.addObject("XY", XY);
				mv.addObject("ZYDM", ZYDM);
				mv.addObject("XZB", XZB);
				mv.addObject("departmentInfoList",departmentInfoList);
				mv.addObject("professionInfoList",professionInfoList);
				mv.addObject("bjdmbList",bjdmbList);
				Page<JobStudent> pageList = jobStudentService.getPracticeSummaryList(XM, XY, ZYDM, XZB, DQSZJ, pageNumber);
					mv.addObject("currentPage", pageNumber);
					mv.addObject("totalPage", pageList.getTotalPage());
					mv.addObject("totalCount", pageList.getTotalCount());
					mv.addObject("jobStudentList", pageList.getResultList());
				/*else {
					System.out.println("11111111111");
					Page<JobStudent> pageList = jobStudentService.getJobStudentList(XM, XY, ZYDM, XZB, DQSZJ, pageNumber);
					Page<StudentInfo> pageList1 = studentInfoService.getStudentNotMatchList(XM, XY, ZYDM, XZB, DQSZJ, pageNumber);
					mv.addObject("currentPage", pageNumber);
					mv.addObject("totalPage", pageList.getTotalPage());
					mv.addObject("totalCount", pageList.getTotalCount());
					mv.addObject("jobStudentList", pageList.getResultList());
					mv.addObject("totalPage", pageList1.getTotalPage());
					mv.addObject("totalCount", pageList1.getTotalCount());
					mv.addObject("jobStudentList", pageList1.getResultList());
				}*/
			}else if(String.valueOf(session.getAttribute(Const.USER_ROLE)).equals("3")){
				this.professionInfoList = professionInfoService.getProfessionInfo(String.valueOf(session.getAttribute(Const.USER_DEPARTMENT_CODE)));
				this.bjdmbList = bjdmbService.getBjdmb(String.valueOf(session.getAttribute(Const.USER_DEPARTMENT_CODE)),null);
				Page<JobStudent> pageList = jobStudentService.getPracticeSummaryList(XM, String.valueOf(session.getAttribute(Const.USER_DEPARTMENT_NAME)), ZYDM, XZB, DQSZJ, pageNumber);
				mv.addObject("currentPage", pageNumber);
				mv.addObject("bjdmbList",bjdmbList);
				mv.addObject("professionInfoList",professionInfoList);
				mv.addObject("ZYDM", ZYDM);
				mv.addObject("XZB", XZB);
				mv.addObject("totalPage", pageList.getTotalPage());
				mv.addObject("totalCount", pageList.getTotalCount());
				mv.addObject("jobStudentList", pageList.getResultList());
			}
			String[] gradeList = StringUtil.getCurrentGrades();
			mv.addObject("gradeList", gradeList);
			mv.addObject("DQSZJ", DQSZJ);
			mv.addObject("XM", XM);
		} catch (Exception ex) {
			ex.printStackTrace();
		}
		return mv;
	}
	/**?
	 * 
	 * 我的实习信息
	 * @return
	 */
	 @RequestMapping("/my_parctice.do")
		public ModelAndView myParctice() { 
		 ModelAndView mv = new ModelAndView();
		 HttpSession session = getSession();
		 try {
		 JobStudent jobStudent =jobStudentService.getJobStudent(String.valueOf(session.getAttribute(Const.SESSION_ACCOUNT)));
			 if (jobStudent!=null) {
				 mv.addObject("jobStudent", jobStudent);
				 mv.setViewName("my_parctice");
			} else {
				 mv.addObject("msg", " 暂无实习信息，您可能还未参加实习吧!");
				 mv.setViewName("error");
			}
		 } catch (Exception ex) {
			ex.printStackTrace();
		}
			return mv;
		}
	 
	 /**?
	  * 我的实习总结
	  */
	 @RequestMapping("/my_practicecomment.do")
		public ModelAndView myPracticecomment() { 
		 ModelAndView mv = new ModelAndView();
		 HttpSession session = getSession();
		 try {
		 JobStudent jobStudent =jobStudentService.getJobStudent(String.valueOf(session.getAttribute(Const.SESSION_ACCOUNT)));
			 if (jobStudent!=null) {
				 PracticeComment practiceComment = practiceCommentService.getPracticeCommentByStudentNumber(String.valueOf(session.getAttribute(Const.SESSION_ACCOUNT)));
				 mv.addObject("practiceComment", practiceComment);
				 mv.setViewName("my_practicecomment");
			} else {
				 mv.addObject("msg", " 您可能还未参加实习,无法填写实习总结!");
				 mv.setViewName("error");
			}
		 } catch (Exception ex) {
			ex.printStackTrace();
		}
			return mv;
		}
	 /**?
	  * 我的实习总结-手机端
	  * @return
	  */
	 @RequestMapping("/moible_my_practicecomment.do")
		public ModelAndView moibleMyPracticecomment() { 
		 ModelAndView mv = new ModelAndView();
		 HttpSession session = getSession();
		 if (!String.valueOf(session.getAttribute(Const.SESSION_ACCOUNT)).equals("null")) {
		 try {
			 System.out.println(String.valueOf(session.getAttribute(Const.SESSION_ACCOUNT))+"===");
		 JobStudent jobStudent =jobStudentService.getJobStudent(String.valueOf(session.getAttribute(Const.SESSION_ACCOUNT)));
			 if (jobStudent!=null) {
				 PracticeComment practiceComment = practiceCommentService.getPracticeCommentByStudentNumber(String.valueOf(session.getAttribute(Const.SESSION_ACCOUNT)));
				 mv.addObject("practiceComment", practiceComment);
				 mv.setViewName("moible_my_practicecomment");
			} else {
				 mv.addObject("msg", " 您可能还未参加实习,无法填写实习总结!");
				 mv.setViewName("error");
			}
		 } catch (Exception ex) {
			ex.printStackTrace();
		}
		 }else {
			 mv.setViewName("login_moible");
	}
			return mv;
		}
	 @RequestMapping("/add_practicecomment.do")
		@ResponseBody
		public JSONObject addPracticecomment(@RequestParam("studentNumber")String  studentNumber,@RequestParam("practiceContent")String  practiceContent,@RequestParam("practiceSummary")String  practiceSummary,@RequestParam("selfComment")String  selfComment  ) {
			JSONObject json = new JSONObject();
			 HttpSession session = getSession();
			if (studentNumber.equals("")) {
				PracticeComment practiceComment =new PracticeComment();
				practiceComment.setStudentNumber(String.valueOf(session.getAttribute(Const.SESSION_ACCOUNT)));
				practiceComment.setPracticeContent(practiceContent);
				practiceComment.setPracticeSummary(practiceSummary);
				practiceComment.setSelfComment(selfComment);
				int rel= practiceCommentService.addPracticeComment(practiceComment);
				json.put("result", rel>0?"success":"error");
			}else {
				 PracticeComment practiceComment = practiceCommentService.getPracticeCommentByStudentNumber(studentNumber);
				practiceComment.setPracticeContent(practiceContent);
				practiceComment.setPracticeSummary(practiceSummary);
				practiceComment.setSelfComment(selfComment);
				int rel= practiceCommentService.editPracticeComment(practiceComment);
				json.put("result", rel>0?"success":"error");
			}
			return json;
		}
	/**?
	 * 老师评价学生总结
	 * @param XH
	 * @return
	 */
	 @RequestMapping("/evaluate.do")
		public ModelAndView evaluate(@RequestParam("XH")String  XH) { 
		 ModelAndView mv = new ModelAndView();
		 try {
				 PracticeComment practiceComment = practiceCommentService.getPracticeCommentByStudentNumber(XH);
			if (practiceComment!=null) {
				 mv.addObject("practiceComment", practiceComment);
				 mv.setViewName("my_practicecomment_evaluate");
			} else {
				 mv.addObject("msg", "该学生未填写实习总结!");
				 mv.setViewName("error");
			}
		 } catch (Exception ex) {
			ex.printStackTrace();
		}
			return mv;
		}
	 @RequestMapping("/add_teacherEvaluate.do")
		@ResponseBody
		public JSONObject addTeacherEvaluate(@RequestParam("studentNumber")String  studentNumber,@RequestParam("teacherComment")String  teacherComment ) {
			JSONObject json = new JSONObject();
				 PracticeComment practiceComment = practiceCommentService.getPracticeCommentByStudentNumber(studentNumber);
				practiceComment.setTeacherComment(teacherComment);
				int rel= practiceCommentService.teacherEvaluate(practiceComment);
				json.put("result", rel>0?"success":"error");
			return json;
		}
	
	 /**?
	  * 实习分配
	  * @return
	  */
	 private List<Province>  provinceList = null;
		private List<City>  cityList = null;
		private List<EnterpriseUser>  enterpriseUserList = null;
		private List<TeacherInfo>  teacherInfoList = null;
		private List<JobInfo>  jobInfoList = null;
	 @RequestMapping("/distribution.do")
		public ModelAndView distribution(@RequestParam String XH) {
		 	ModelAndView mv = new ModelAndView();
		 	mv.setViewName("practice_student_distribution");
		 	StudentInfo studentInfo = studentInfoService.getStudentInfoByXH(XH);
			DepartmentInfo departmentInfo = departmentInfoService.getDepartmentInfo(studentInfo.getXY());
		 	this.provinceList = enterpriseinfoService.getProvince();
			this.cityList = enterpriseinfoService.getCity(provinceList.get(0).getProvinceId());
			List<EnterpriseInfo> enterpriseinfoList = enterpriseinfoService.getEnterpriseinfoEnterList(provinceList.get(0).getProvinceId(), cityList.get(0).getCityId());
			if( enterpriseinfoList.size() !=0||enterpriseinfoList!=null) {
				this.enterpriseUserList = enterpriseUserService.getDistributionEnterpriseuserList(enterpriseinfoList.get(0).getId());
				mv.addObject("enterpriseUserList",enterpriseUserList);
			}
			this.teacherInfoList = teacherInfoService.getDistributionTeacherInfoList(studentInfo.getXY());
			this.jobInfoList = jobInfoService.getDistributionJobinfoList(departmentInfo.getXYDM());
			mv.addObject("provinceList",provinceList);
			mv.addObject("cityList",cityList);
			mv.addObject("enterpriseinfoList",enterpriseinfoList);
			mv.addObject("teacherInfoList",teacherInfoList);
			mv.addObject("jobInfoList",jobInfoList);
			mv.addObject("XH",XH);
		 return mv;
	 }
		@RequestMapping("/province.do")
		@ResponseBody
		public JSONObject province(@RequestParam("ProvinceId")int ProvinceId  ) {
			JSONObject json = new JSONObject();
			this.cityList = enterpriseinfoService.getCity(ProvinceId);
			json.put("cityList", cityList);
			List<EnterpriseInfo> enterpriseinfoList = enterpriseinfoService.getEnterpriseinfoEnterList(ProvinceId,cityList.get(0).getCityId());
			json.put("enterpriseinfoList", enterpriseinfoList);
			this.enterpriseUserList = enterpriseUserService.getDistributionEnterpriseuserList(enterpriseinfoList.get(0).getId());
			json.put("enterpriseUserList", enterpriseUserList);
			return json;
		}
		@RequestMapping("/city.do")
		@ResponseBody
		public JSONObject city(@RequestParam("cityId")int cityId  ) {
			JSONObject json = new JSONObject();
			List<EnterpriseInfo> enterpriseinfoList = enterpriseinfoService.getEnterpriseinfoEnterList(0,cityId);
			json.put("enterpriseinfoList", enterpriseinfoList);
			this.enterpriseUserList = enterpriseUserService.getDistributionEnterpriseuserList(enterpriseinfoList.get(0).getId());
			json.put("enterpriseUserList", enterpriseUserList);
			return json;
		}
	 @RequestMapping("/enterpriseinfo.do")
		@ResponseBody
		public JSONObject enterpriseinfo(@RequestParam("EnterpriseId")int EnterpriseId  ) {
			JSONObject json = new JSONObject();
			this.enterpriseUserList = enterpriseUserService.getDistributionEnterpriseuserList(EnterpriseId);
			json.put("enterpriseUserList", enterpriseUserList);
			return json;
		}
	 /**?
	  * 自训企业和专升本  分配
	  * @param XH
	  * @param EnterpriseName
	  * @param TheAddress
	  * @param TheContact
	  * @param TheContactPhone
	  * @param SchoolTeacher
	  * @param startTime
	  * @param endTime
	  * @return
	  */
	 @RequestMapping("/selfEnterprise_save.do")
		@ResponseBody
		public JSONObject selfEnterprise(@RequestParam("XH")String  XH,@RequestParam("Status") int Status,@RequestParam("EnterpriseName") String EnterpriseName,@RequestParam("TheAddress") String TheAddress,@RequestParam("TheContact") String TheContact,@RequestParam("TheContactPhone") String TheContactPhone,@RequestParam("SchoolTeacher") String SchoolTeacher ,@RequestParam("startTime") String startTime ,@RequestParam("endTime") String endTime ) {
			JSONObject json = new JSONObject();
			try {
				EnterpriseInfo enterpriseInfo = new EnterpriseInfo();
				enterpriseInfo.setName(EnterpriseName);
				enterpriseInfo.setTheAddress(TheAddress);
				enterpriseInfo.setTheContact(TheContact);
				enterpriseInfo.setTheContactPhone(TheContactPhone);
				enterpriseInfo.setCreateType(1);
				int rel = enterpriseinfoService.addEnterpriseinfo(enterpriseInfo);
				if (rel>0) {
					JobStudent jobStudent = new JobStudent();
					StudentInfo studentInfo = studentInfoService.getStudentInfoByXH(XH);
					TeacherInfo teacherInfo = teacherInfoService.geTeacherInfoByZGH(SchoolTeacher);
					jobStudent.setXH(XH);
					jobStudent.setXM(studentInfo.getXM());
					jobStudent.setXY(studentInfo.getXY());
					jobStudent.setXZB(studentInfo.getXZB());
					jobStudent.setZYDM(studentInfo.getZYDM());
					jobStudent.setDQSZJ(studentInfo.getDQSZJ());
					jobStudent.setLXDH(studentInfo.getLXDH());
					jobStudent.setSchoolTeacher(SchoolTeacher);
					jobStudent.setSchTeacherName(teacherInfo.getXM());
					jobStudent.setEnterpriseName(EnterpriseName);
					jobStudent.setPracticeEnterprise(enterpriseInfo.getId());
					jobStudent.setStatus(Status);
					jobStudentService.addJobStudent(jobStudent);
					
				}
				json.put("result", rel>0?"success":"error");
			} catch (Exception ex) {
				ex.printStackTrace();
			}
			return json;
		}
	 /**?
	  * 专升本 分配
	  * @param XH
	  * @param EnterpriseName
	  * @param TheAddress
	  * @param TheContact
	  * @param TheContactPhone
	  * @param SchoolTeacher
	  * @param startTime
	  * @param endTime
	  * @return
	  *//*
	 @RequestMapping("/upgraded_save.do")
		@ResponseBody
		public JSONObject upgraded(@RequestParam("XH")String  XH,@RequestParam("EnterpriseName") String EnterpriseName,@RequestParam("TheAddress") String TheAddress,@RequestParam("TheContact") String TheContact,@RequestParam("TheContactPhone") String TheContactPhone,@RequestParam("SchoolTeacher") String SchoolTeacher ,@RequestParam("startTime") String startTime ,@RequestParam("endTime") String endTime ) {
			JSONObject json = new JSONObject();
			try {
				EnterpriseInfo enterpriseInfo = new EnterpriseInfo();
				enterpriseInfo.setName(EnterpriseName);
				enterpriseInfo.setTheAddress(TheAddress);
				enterpriseInfo.setTheContact(TheContact);
				enterpriseInfo.setTheContactPhone(TheContactPhone);
				enterpriseInfo.setCreateType(1);
				int rel = enterpriseinfoService.addEnterpriseinfo(enterpriseInfo);
				if (rel>0) {
					JobStudent jobStudent = new JobStudent();
					StudentInfo studentInfo = studentInfoService.getStudentInfoByXH(XH);
					TeacherInfo teacherInfo = teacherInfoService.geTeacherInfoByZGH(SchoolTeacher);
					jobStudent.setXH(XH);
					jobStudent.setXM(studentInfo.getXM());
					jobStudent.setXY(studentInfo.getXY());
					jobStudent.setXZB(studentInfo.getXZB());
					jobStudent.setZYDM(studentInfo.getZYDM());
					jobStudent.setDQSZJ(studentInfo.getDQSZJ());
					jobStudent.setLXDH(studentInfo.getLXDH());
					jobStudent.setSchoolTeacher(SchoolTeacher);
					jobStudent.setSchTeacherName(teacherInfo.getXM());
					jobStudent.setEnterpriseName(EnterpriseName);
					jobStudent.setPracticeEnterprise(enterpriseInfo.getId());
					jobStudentService.addJobStudent(jobStudent);
					jobStudent.setStatus(2);
				}
				json.put("result", rel>0?"success":"error");
			} catch (Exception ex) {
				ex.printStackTrace();
			}
			return json;
		}*/
	 /**?
	  * 学校分配  实习分配
	  * @param XH
	  * @param PracticeEnterprise
	  * @param EnterTeacherId
	  * @param JobId
	  * @param SchoolTeacher
	  * @param startTime
	  * @param endTime
	  * @return
	  */
	 @RequestMapping("/school_assignment.do")
		@ResponseBody
		public JSONObject schoolAssignment(@RequestParam("XH")String  XH,@RequestParam("PracticeEnterprise") int PracticeEnterprise,@RequestParam("EnterTeacherId") String EnterTeacherId,@RequestParam("JobId") int JobId,@RequestParam("SchoolTeacher") String SchoolTeacher,@RequestParam("startTime") String startTime ,@RequestParam("endTime") String endTime ) {
			JSONObject json = new JSONObject();
			try {
					EnterpriseInfo enterpriseInfo= 	 enterpriseinfoService.getEnterpriseinfo(PracticeEnterprise);
					try {
						EnterTeacherId = new String(EnterTeacherId.getBytes("ISO-8859-1"),"UTF-8");
						
					} catch (UnsupportedEncodingException e) {
						e.printStackTrace();
					}
					EnterpriseUser enterpriseUser = enterpriseUserService.getEnterpriseuser(EnterTeacherId);
					System.out.println(enterpriseUser.getName()+"=======");
					JobInfo jobInfo = jobInfoService.getJobinfo(JobId);
					JobStudent jobStudent = new JobStudent();
					StudentInfo studentInfo = studentInfoService.getStudentInfoByXH(XH);
					TeacherInfo teacherInfo = teacherInfoService.geTeacherInfoByZGH(SchoolTeacher);
					jobStudent.setXH(XH);
					jobStudent.setXM(studentInfo.getXM());
					jobStudent.setXY(studentInfo.getXY());
					jobStudent.setXZB(studentInfo.getXZB());
					jobStudent.setZYDM(studentInfo.getZYDM());
					jobStudent.setDQSZJ(studentInfo.getDQSZJ());
					jobStudent.setLXDH(studentInfo.getLXDH());
					jobStudent.setSchoolTeacher(SchoolTeacher);
					jobStudent.setSchTeacherName(teacherInfo.getXM());
					jobStudent.setEnterpriseName(enterpriseInfo.getName());
					jobStudent.setPracticeEnterprise(enterpriseInfo.getId());
					jobStudent.setJobId(JobId);
					jobStudent.setJobName(jobInfo.getJobName());
					jobStudent.setEnterTeacherId(EnterTeacherId);
					jobStudent.setEnterTeacherName(enterpriseUser.getUserName());
					jobStudent.setEnterTeacherPhone(enterpriseUser.getUserPhone());
					jobStudent.setStatus(4);
				int rel =	jobStudentService.addJobStudent(jobStudent);
				json.put("result", rel>0?"success":"error");
			} catch (Exception ex) {
				ex.printStackTrace();
			}
			return json;
}
	 /**?
	  * 创业 实习分配
	  * @param XH
	  * @param EnterpriseName
	  * @param SchoolTeacher
	  * @param startTime
	  * @param endTime
	  * @return
	  */
	 @RequestMapping("/entrepreneurshipEnterprise_save.do")
		@ResponseBody
		public JSONObject entrepreneurshipEnterprise(@RequestParam("XH")String  XH,@RequestParam("EnterpriseName") String EnterpriseName,@RequestParam("SchoolTeacher") String SchoolTeacher,@RequestParam("startTime") String startTime ,@RequestParam("endTime") String endTime ) {
			JSONObject json = new JSONObject();
			try {
					JobStudent jobStudent = new JobStudent();
					StudentInfo studentInfo = studentInfoService.getStudentInfoByXH(XH);
					TeacherInfo teacherInfo = teacherInfoService.geTeacherInfoByZGH(SchoolTeacher);
					jobStudent.setXH(XH);
					jobStudent.setXM(studentInfo.getXM());
					jobStudent.setXY(studentInfo.getXY());
					jobStudent.setXZB(studentInfo.getXZB());
					jobStudent.setZYDM(studentInfo.getZYDM());
					jobStudent.setDQSZJ(studentInfo.getDQSZJ());
					jobStudent.setLXDH(studentInfo.getLXDH());
					jobStudent.setSchoolTeacher(SchoolTeacher);
					jobStudent.setEnterpriseName(EnterpriseName);
					jobStudent.setSchTeacherName(teacherInfo.getXM());
					jobStudent.setStatus(1);
				int rel =	jobStudentService.addJobStudent(jobStudent);
				json.put("result", rel>0?"success":"error");
			} catch (Exception ex) {
				ex.printStackTrace();
			}
			return json;
}
	 /**?
	  * 指导老师指导的学生列表
	  * @param ZGH
	  * @return
	  */
	 @RequestMapping("/guide_student_list.do")
		public ModelAndView getGuideStudentsList(@RequestParam("ZGH")String  ZGH) {
			return getGuideStudentsList(ZGH,1);
		}
	 @RequestMapping("/guide_student_page_list.do")
		public ModelAndView getGuideStudentsList(@RequestParam String ZGH,@RequestParam int pageNumber) {
			ModelAndView mv = new ModelAndView("guide_student_list");
			TeacherInfo teacherInfo = teacherInfoService.geTeacherInfoByZGH(ZGH);
			Page<JobStudent> pageList = jobStudentService.getGuideStudentsList(ZGH, pageNumber);
			mv.addObject("currentPage", pageNumber);
			mv.addObject("totalPage", pageList.getTotalPage());
			mv.addObject("totalCount", pageList.getTotalCount());
			mv.addObject("guideStudentList", pageList.getResultList());
			mv.addObject("teacherInfo",teacherInfo);
			return mv;
		}
	 /**?
	  * 指导老师 -学生实习管理
	  * @return
	  */
	 @RequestMapping("/th_jobStudent_list.do")
		public ModelAndView getThStudentInfoList() {
			return getThStudentInfoList(1);
		}
	 
	 @RequestMapping("/th_student_page_list.do")
		public ModelAndView getThStudentInfoList(@RequestParam int pageNumber) {
			ModelAndView mv = new ModelAndView("teacher_student_list");
			HttpSession session = getSession();
			Page<JobStudent> pageList = jobStudentService.getGuideStudentsList(String.valueOf(session.getAttribute(Const.SESSION_ACCOUNT)), pageNumber);
			mv.addObject("currentPage", pageNumber);
			mv.addObject("totalPage", pageList.getTotalPage());
			mv.addObject("totalCount", pageList.getTotalCount());
			mv.addObject("guideStudentList", pageList.getResultList());
			return mv;
		}
	 @RequestMapping("/change.do")
		public ModelAndView change(@RequestParam("XH") String XH) {
		 	ModelAndView mv = new ModelAndView();
		 	mv.setViewName("teacher_student_change");
		 	StudentInfo studentInfo = studentInfoService.getStudentInfoByXH(XH);
			DepartmentInfo departmentInfo = departmentInfoService.getDepartmentInfo(studentInfo.getXY());
		 	this.provinceList = enterpriseinfoService.getProvince();
			this.cityList = enterpriseinfoService.getCity(provinceList.get(0).getProvinceId());
			List<EnterpriseInfo> enterpriseinfoList = enterpriseinfoService.getEnterpriseinfoEnterList(provinceList.get(0).getProvinceId(), cityList.get(0).getCityId());
			this.enterpriseUserList = enterpriseUserService.getDistributionEnterpriseuserList(enterpriseinfoList.get(0).getId());
			this.teacherInfoList = teacherInfoService.getDistributionTeacherInfoList(studentInfo.getXY());
			this.jobInfoList = jobInfoService.getDistributionJobinfoList(departmentInfo.getXYDM());
			mv.addObject("provinceList",provinceList);
			mv.addObject("cityList",cityList);
			mv.addObject("enterpriseinfoList",enterpriseinfoList);
			mv.addObject("enterpriseUserList",enterpriseUserList);
			mv.addObject("teacherInfoList",teacherInfoList);
			mv.addObject("jobInfoList",jobInfoList);
			mv.addObject("XH",XH);
		 return mv;
	 }
	 /**?
	  * 自训企业和专升本  变更
	  * @param XH
	  * @param EnterpriseName
	  * @param TheAddress
	  * @param TheContact
	  * @param TheContactPhone
	  * @param SchoolTeacher
	  * @param startTime
	  * @param endTime
	  * @return
	  */
	 @RequestMapping("/selfEnterprise_edit.do")
		@ResponseBody
		public JSONObject selfEnterpriseEdit(@RequestParam("XH")String  XH,@RequestParam("Status") int Status,@RequestParam("EnterpriseName") String EnterpriseName,@RequestParam("TheAddress") String TheAddress,@RequestParam("TheContact") String TheContact,@RequestParam("TheContactPhone") String TheContactPhone,@RequestParam("SchoolTeacher") String SchoolTeacher ,@RequestParam("startTime") String startTime ,@RequestParam("endTime") String endTime ) {
			JSONObject json = new JSONObject();
			try {
				EnterpriseInfo enterpriseInfo = new EnterpriseInfo();
				enterpriseInfo.setName(EnterpriseName);
				enterpriseInfo.setTheAddress(TheAddress);
				enterpriseInfo.setTheContact(TheContact);
				enterpriseInfo.setTheContactPhone(TheContactPhone);
				enterpriseInfo.setCreateType(1);
				int rel = enterpriseinfoService.addEnterpriseinfo(enterpriseInfo);
				if (rel>0) {
					TeacherInfo teacherInfo = teacherInfoService.geTeacherInfoByZGH(SchoolTeacher);
					JobStudent jobStudent = jobStudentService.getJobStudent(XH);
					jobStudent.setJobId(0);
					jobStudent.setJobName("");
					jobStudent.setPracticeEnterprise( enterpriseInfo.getCreateType());
					jobStudent.setEnterpriseName(EnterpriseName);
					jobStudent.setSchoolTeacher(SchoolTeacher);
					jobStudent.setSchTeacherName(teacherInfo.getXM());
					jobStudent.setEnterTeacherId("");
					jobStudent.setEnterTeacherName("");
					jobStudent.setEnterTeacherPhone("");
					jobStudent.setStartTime(startTime);
					jobStudent.setEndTime(endTime);
					jobStudent.setStatus(Status);
					jobStudentService.updateJobStudent(jobStudent);
				}
				json.put("result", rel>0?"success":"error");
			} catch (Exception ex) {
				ex.printStackTrace();
			}
			return json;
		}
	 /**?
	  * 学校分配  实习 变更
	  * @param XH
	  * @param PracticeEnterprise
	  * @param EnterTeacherId
	  * @param JobId
	  * @param SchoolTeacher
	  * @param startTime
	  * @param endTime
	  * @return
	  */
	 @RequestMapping("/school_assignment_edit.do")
		@ResponseBody
		public JSONObject schoolAssignmentEdit(@RequestParam("XH")String  XH,@RequestParam("PracticeEnterprise") int PracticeEnterprise,@RequestParam("EnterTeacherId") String EnterTeacherId,@RequestParam("JobId") int JobId,@RequestParam("SchoolTeacher") String SchoolTeacher,@RequestParam("startTime") String startTime ,@RequestParam("endTime") String endTime ) {
			JSONObject json = new JSONObject();
			try {
					EnterpriseInfo enterpriseInfo= 	 enterpriseinfoService.getEnterpriseinfo(PracticeEnterprise);
					try {
						EnterTeacherId = new String(EnterTeacherId.getBytes("ISO-8859-1"),"UTF-8");
						
					} catch (UnsupportedEncodingException e) {
						e.printStackTrace();
					}
					EnterpriseUser enterpriseUser = enterpriseUserService.getEnterpriseuser(EnterTeacherId);
					System.out.println(enterpriseUser.getName()+"=======");
					JobInfo jobInfo = jobInfoService.getJobinfo(JobId);
					JobStudent jobStudent = jobStudentService.getJobStudent(XH);
					TeacherInfo teacherInfo = teacherInfoService.geTeacherInfoByZGH(SchoolTeacher);
					jobStudent.setSchoolTeacher(SchoolTeacher);
					jobStudent.setSchTeacherName(teacherInfo.getXM());
					jobStudent.setEnterpriseName(enterpriseInfo.getName());
					jobStudent.setPracticeEnterprise(enterpriseInfo.getId());
					jobStudent.setJobId(JobId);
					jobStudent.setJobName(jobInfo.getJobName());
					jobStudent.setEnterTeacherId(EnterTeacherId);
					jobStudent.setEnterTeacherName(enterpriseUser.getUserName());
					jobStudent.setEnterTeacherPhone(enterpriseUser.getUserPhone());
					jobStudent.setStatus(4);
				int rel =	jobStudentService.updateJobStudent(jobStudent);
				json.put("result", rel>0?"success":"error");
			} catch (Exception ex) {
				ex.printStackTrace();
			}
			return json;
}
	 /**?
	  * 创业 实习 变更
	  * @param XH
	  * @param EnterpriseName
	  * @param SchoolTeacher
	  * @param startTime
	  * @param endTime
	  * @return
	  */
	 @RequestMapping("/entrepreneurshipEnterprise_edit.do")
		@ResponseBody
		public JSONObject entrepreneurshipEnterpriseEdit(@RequestParam("XH")String  XH,@RequestParam("EnterpriseName") String EnterpriseName,@RequestParam("SchoolTeacher") String SchoolTeacher,@RequestParam("startTime") String startTime ,@RequestParam("endTime") String endTime ) {
			JSONObject json = new JSONObject();
			try {
					JobStudent jobStudent = jobStudentService.getJobStudent(XH);
					TeacherInfo teacherInfo = teacherInfoService.geTeacherInfoByZGH(SchoolTeacher);
					jobStudent.setSchoolTeacher(SchoolTeacher);
					jobStudent.setSchTeacherName(teacherInfo.getXM());
					jobStudent.setJobId(0);
					jobStudent.setJobName("");
					jobStudent.setPracticeEnterprise(0);
					jobStudent.setEnterpriseName(EnterpriseName);
					jobStudent.setEnterTeacherId("");
					jobStudent.setEnterTeacherName("");
					jobStudent.setEnterTeacherPhone("");
					jobStudent.setStartTime(startTime);
					jobStudent.setEndTime(endTime);
					jobStudent.setStatus(1);
				int rel =	jobStudentService.updateJobStudent(jobStudent);
				json.put("result", rel>0?"success":"error");
			} catch (Exception ex) {
				ex.printStackTrace();
			}
			return json;
}
	 /**?
	  * 导出excel
	  * @return
	  */
		@RequestMapping(value="/excel")
		public ModelAndView exportExcel(){
			ModelAndView mv = new ModelAndView();
			try{
				Map<String,Object> dataMap = new HashMap<String,Object>();
				List<String> titles = new ArrayList<String>();
				titles.add("学号");
				titles.add("姓名");
				titles.add("状态");
				titles.add("实习岗位");
				titles.add("实习企业");	
				titles.add("校内指导老师"); 
				titles.add("企业指导老师及电话"); 
				dataMap.put("titles", titles);
				final List<JobStudent> inputList = jobStudentService.getJobStudentList();
				List<HashMap> outList = new ArrayList<HashMap>();
				HashMap map = null;
				for(int i=0;i<inputList.size();i++){
					map = new HashMap();
					map.put("var1", inputList.get(i).getXH());	 
					map.put("var2", inputList.get(i).getXM());
					if (inputList.get(i).getStatus()==0) {
						map.put("var3","在校");
					}else if (inputList.get(i).getStatus()==1) {
						map.put("var3","自主创业");
					}else if(inputList.get(i).getStatus()==2){
						map.put("var3","专升本");
					}else if(inputList.get(i).getStatus()==3){
						map.put("var3","自寻企业实习");
					}else if(inputList.get(i).getStatus()==4)
							map.put("var3","学校分配企业");
					map.put("var4", inputList.get(i).getJobName());
					map.put("var5", inputList.get(i).getEnterpriseName());
					map.put("var6", inputList.get(i).getSchTeacherName());
					map.put("var7", inputList.get(i).getEnterTeacherName()+"-"+inputList.get(i).getEnterTeacherPhone());
					outList.add(map);
				}
				dataMap.put("outList", outList);
				ObjectExcelView erv = new ObjectExcelView();
				mv = new ModelAndView(erv,dataMap);
			} catch(Exception e){
				logger.error(e.toString(), e);
			}
			return mv;
		}
		/**?
		 * 实习信息统计
		 */
		@RequestMapping("/practice_statistics.do")
		public ModelAndView practiceStatistics() {
			return practiceStatistics(null,null,null,0);
			
		}
		@RequestMapping("/practice_statistics_page.do")
		public ModelAndView practiceStatistics(@RequestParam String XY,@RequestParam String ZYDM,@RequestParam String XZB,@RequestParam int DQSZJ) {
			ModelAndView mv = new ModelAndView("practice_statistics");
			HttpSession session = getSession();
			if (String.valueOf(session.getAttribute(Const.USER_ROLE)).equals("2")||String.valueOf(session.getAttribute(Const.USER_ROLE)).equals("1")) {
				this.departmentInfoList = departmentInfoService.getDepartmentInfoList();
				if(XY==null){
					this.professionInfoList = professionInfoService.getProfessionInfoList();
					this.bjdmbList = bjdmbService.getBjdmbList();
				}else {
					DepartmentInfo departmentInfo=	departmentInfoService.getDepartmentInfo(XY);
					if (departmentInfo!=null) {
						this.professionInfoList = professionInfoService.getProfessionInfo(departmentInfo.getXYDM());
						if(ZYDM!=null){
							this.bjdmbList = bjdmbService.getBjdmb(departmentInfo.getXYDM(),ZYDM);
						}else {
							this.bjdmbList = bjdmbService.getBjdmb(departmentInfo.getXYDM(),null);	
						}
					}
				}
				mv.addObject("XY", XY);
				mv.addObject("ZYDM", ZYDM);
				mv.addObject("XZB", XZB);
				mv.addObject("departmentInfoList",departmentInfoList);
				mv.addObject("professionInfoList",professionInfoList);
				mv.addObject("bjdmbList",bjdmbList);
				int theSchoolCount =jobStudentService.theSchool(XY, ZYDM, XZB, DQSZJ);
				int upgradedBookCount =jobStudentService.upgradedBook(XY, ZYDM, XZB, DQSZJ);
				int selfSeekingCount =jobStudentService.selfSeeking(XY, ZYDM, XZB, DQSZJ);
				int entrepreneurshipCount =jobStudentService.entrepreneurship(XY, ZYDM, XZB, DQSZJ);
				int schoolAssignmentCount =jobStudentService.schoolAssignment(XY, ZYDM, XZB, DQSZJ);
				int hefeiCount =jobStudentService.hefeiCount(XY, ZYDM, XZB, DQSZJ);
				int wuhuCount =jobStudentService.wuhuCount(XY, ZYDM, XZB, DQSZJ);
				int nanjingCount =jobStudentService.nanjingCount(XY, ZYDM, XZB, DQSZJ);
				mv.addObject("theSchoolCount",theSchoolCount);
				mv.addObject("upgradedBookCount",upgradedBookCount);
				mv.addObject("selfSeekingCount",selfSeekingCount);	
				mv.addObject("entrepreneurshipCount",entrepreneurshipCount);
				mv.addObject("schoolAssignmentCount",schoolAssignmentCount);
				mv.addObject("hefeiCount",hefeiCount);	
				mv.addObject("wuhuCount",wuhuCount);
				mv.addObject("nanjingCount",nanjingCount);
				}else {
					this.professionInfoList = professionInfoService.getProfessionInfo(String.valueOf(session.getAttribute(Const.USER_DEPARTMENT_CODE)));
					this.bjdmbList = bjdmbService.getBjdmb(String.valueOf(session.getAttribute(Const.USER_DEPARTMENT_CODE)),null);
					int theSchoolCount =jobStudentService.theSchool(String.valueOf(session.getAttribute(Const.USER_DEPARTMENT_NAME)), ZYDM, XZB, DQSZJ);
					int upgradedBookCount =jobStudentService.upgradedBook(String.valueOf(session.getAttribute(Const.USER_DEPARTMENT_NAME)), ZYDM, XZB, DQSZJ);
					int selfSeekingCount =jobStudentService.selfSeeking(String.valueOf(session.getAttribute(Const.USER_DEPARTMENT_NAME)), ZYDM, XZB, DQSZJ);
					int entrepreneurshipCount =jobStudentService.entrepreneurship(String.valueOf(session.getAttribute(Const.USER_DEPARTMENT_NAME)), ZYDM, XZB, DQSZJ);
					int schoolAssignmentCount =jobStudentService.schoolAssignment(String.valueOf(session.getAttribute(Const.USER_DEPARTMENT_NAME)), ZYDM, XZB, DQSZJ);
					int hefeiCount =jobStudentService.hefeiCount(String.valueOf(session.getAttribute(Const.USER_DEPARTMENT_NAME)), ZYDM, XZB, DQSZJ);
					int wuhuCount =jobStudentService.wuhuCount(String.valueOf(session.getAttribute(Const.USER_DEPARTMENT_NAME)), ZYDM, XZB, DQSZJ);
					int nanjingCount =jobStudentService.nanjingCount(String.valueOf(session.getAttribute(Const.USER_DEPARTMENT_NAME)), ZYDM, XZB, DQSZJ);
					mv.addObject("theSchoolCount",theSchoolCount);
					mv.addObject("upgradedBookCount",upgradedBookCount);
					mv.addObject("selfSeekingCount",selfSeekingCount);	
					mv.addObject("entrepreneurshipCount",entrepreneurshipCount);
					mv.addObject("schoolAssignmentCount",schoolAssignmentCount);
					mv.addObject("hefeiCount",hefeiCount);	
					mv.addObject("wuhuCount",wuhuCount);
					mv.addObject("nanjingCount",nanjingCount);
					mv.addObject("bjdmbList",bjdmbList);
					mv.addObject("professionInfoList",professionInfoList);
					mv.addObject("ZYDM", ZYDM);
					mv.addObject("XZB", XZB);
				}
			String[] gradeList = StringUtil.getCurrentGrades();
			mv.addObject("gradeList", gradeList);
			mv.addObject("DQSZJ", DQSZJ);
			return mv;
		}
}